
        function ifempty(el){
            if (el.value != "") {
                $(el).parent().children("span").css("display","none");
                return true;
            }else{
                $(el).parent().children("span").css("display","inline-block");
                return false;
            }
        }

		EventUtil.addHandler(window, "load", function(){
		    var enterButton = getEl("enterButton");
            EventUtil.addHandler(enterButton, "click", function(){
                var imput_name = document.getElementsByName("m_name")[0];
                var imput_nicknanme = document.getElementsByName("m_nicknanme")[0];
                var imput_password = document.getElementsByName("m_password")[0];

                var bool_name = ifempty(imput_name);
                var bool_nickname = ifempty(imput_nicknanme);
                var bool_password = ifempty(imput_password);
                if(bool_name && bool_nickname && bool_password){
                    var m_name = imput_name.value;
                    var m_sex = document.getElementsByName("m_sex")[0].value;
                    var m_nicknanme = imput_nicknanme.value;
                    var m_password = imput_password.value;
                    var m_tele = document.getElementsByName("m_tele")[0].value;
                    var m_address = document.getElementsByName("m_address")[0].value;
                    var info = {
                        m_name: m_name,
                        m_sex: m_sex,
                        m_nicknanme: m_nicknanme,
                        m_password: m_password,
                        m_tele: m_tele,
                        m_address: m_address,
                    };
                   AjaxIO.post("/user/register",info,
                        function (result) {
                            $.toast("注册成功");
                            location.href = "login.html";
                            
                        },function(result)
                        {
                            if(result.status==401)
                               $.toast("该用户已存在");
                            

                                   

                        }

                            );
                }
            });
    	});
